package com.fileshare.web.entity;

import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.command.BaseModel;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.*;

import java.util.Date;

import static com.fileshare.web.constant.EntityConstant.SEQ_LEN;

/**
 * 用户基本信息
 */
@Table(name = "user")
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class User extends BaseModel {
    @Column(name = "id", type = MySqlTypeConstant.INT, length = 11, isKey = true, isAutoIncrement = true)
    private Integer id;

    @Column(name = "user_name", type = MySqlTypeConstant.VARCHAR, length = 64)
    private String userName;

    @Column(name = "nick_name", type = MySqlTypeConstant.VARCHAR, length = 64)
    private String nickName;

    @Column(name = "avatar", type = MySqlTypeConstant.VARCHAR, length = 256)
    private String avatar;

    @Column(name = "user_seq", type = MySqlTypeConstant.VARCHAR, length = SEQ_LEN)
    private String userSeq;

    @Column(name = "password", type = MySqlTypeConstant.VARCHAR, length = 64)
    private String password;

    @Column(name = "salt", type = MySqlTypeConstant.VARCHAR, length = 64)
    private String salt;

    @Column(name = "user_type", type = MySqlTypeConstant.VARCHAR, length = 32)
    private String userType;

    @Column(name = "third_party_seq", type = MySqlTypeConstant.VARCHAR, length = SEQ_LEN)
    private String thirdPartySeq;

    @Column(name = "gender", type = MySqlTypeConstant.VARCHAR, length = 64)
    private String gender;

    @Column(name = "email", type = MySqlTypeConstant.VARCHAR, length = 64)
    private String email;

    @Column(name = "join_count", type = MySqlTypeConstant.INT, length = 11)
    private Integer joinCount;

    @Column(name = "is_admin", type = MySqlTypeConstant.BIT, length = 1)
    private Boolean isAdmin;

    @Column(name = "create_at", type = MySqlTypeConstant.DATETIME)
    private Date createAt;

    @Column(name = "update_at", type = MySqlTypeConstant.DATETIME)
    private Date updateAt;

    @Column(name = "create_by", type = MySqlTypeConstant.CHAR, length = SEQ_LEN)
    private String createBy;

    @Column(name = "update_by", type = MySqlTypeConstant.CHAR, length = SEQ_LEN)
    private String updateBy;
}
